Serial Mouse Driver
©1992, 1993 Charles Rentmeesters

CDware.  If you use this software, you've probably saved a bundle on getting a IBM type serial mouse, so spend a few bucks more and send me a CD.  Either Musical CD's or CDROM's.  Send me something unique, send me something original.  If you're in a foreign country send me a CD in your native language.  Of course, if you don't have the time to send me a CD, a donation of about $10 is just as accepted.
Send to:
	Charles Rentmeesters
	410 N Carroll St
	Madison, WI 53703-1804
	USA

I'd love to hear your suggestions.  Email address:
	rentmees@cae.wisc.edu

What is it?
This cdev/init allows you to connect a IBM type serial mouse to your Macintosh, and use that instead of the standard Macintosh mouse.  It works with Microsoft and Mouse Systems compatible mice.  (just about the only two types of serial mice that are out there).  You can even use IBM type serial trackballs with it!  Connect the mouse up to one of the serial ports of your Macintosh, and drop this cdev/init into your System folder.  Use the control panel or System 7 to set-up the mouse driver.  This allows you to set up which port the mouse is connected to, and what type of mouse it is.  It also allows you to modify the event the mouse sends for each of the mouse buttons.  Software written using the Symantic Think C compiler, and tested on a Macintosh IIci running system 7.1.

Connecting up the Serial Mouse:
To connect the serial mouse up to your Macintosh, you will need a serial cable.  Some serial mice can just use a standard modem serial cable that you can buy from many computer stores.  If that doesn't work, you can make your own serial cable for the mouse. A common symptom of not working with the standard serial modem cable is that the mouse buttons will work, but the mouse will not move.  This happens when the mouse in question requires that there be power on RTS and DTR line, which the standard serial mouse cable does not provide.

This is the standard pinouts for a serial mouse cable:
(looking at the cable, with male connectors on both ends)
Macintosh
8 minidin
Pin #	Macintosh
Description	RS232
Name	Mouse
db9
Pin #	Mouse
db25
Pin #	
					
1	Handshake Out	RTS	7	4	
1	Handshake Out	DTR	4	20	
2	Handshake In	CTS	8	5	
3	Transmit Data	TD	3	2	
4	Ground	GND	5	7	
5	Receive Data -	RD	2	3	
8	Receive Data +	GND	5	7	

Helpful hints:
When installing the mouse driver, be sure you have a back-up way to move the mouse in case you don't get it to work right away.  Either keep your old ADB mouse connected, or have Easy Access installed in your system.  Also, terminal programs which are set-up for the same port as the Serial Mouse Driver is set up for may crash.  When making the serial cable, it's easy to buy a Macintosh serial cable, and cut it in half and then solder the db9 connector to the cut end.  That way you don't have to do any soldering to a 8pin mini-din.

Serial Mouse Protocol (for Mouse Systems Mice):
Events are sent in 5 byte packets at 1200 baud.  The first byte is a sync byte, in the format 10000LMR, anding any byte with $F8 and then comparing to $80 will tell you if it's the sync byte.  The bits L, M, and R and the status of the mouse buttons.  1 = button up, 0 = button down.  The second byte in the packet is the horizontal change in pixels.  The third byte is a vertical change.  The fourth and fifth bytes are horizontal and vertical change bytes respectively.

Serial Mouse Protocol (for Microsoft Mice):
Events are sent in 3 byte packets at 1200 baud.  The first byte is a sync byte, in the format 11LRYYXX, anding any byte with $C0 and then comparing to $C0 will tell you if it's the sync byte.  The bits L, and R and the status of the mouse buttons.  0 = button up, 1 = button down.  YY is the most significant two bits of the vertical movement.  XX is the most significant two bits of the horizontal movement.  The second byte in the packet has the format 10XXXXXX.  These are the lower 6 bits of the horizontal movement.  This must be combined with the two bits in the sync byte to get the value for the horizontal movement.  The third byte is of the format 10YYYYYY.  This is the lower 6 bits of the vertical movement.  This must be combined with the sync byte like the horizontal movement to get the value for the vertical movement.

Changes in version 1.0.1:
•	Bug fixed that caused crash in systems earlier than system 7.  (And system 7 too, but you really had to do work to get it to do it!)
•	Improved Documentation.
•	Version display added to lower right corner of control panel.
•	Double-click mouse event added to types of events.
•	Color Icons added.
•	Now type of mouse option is updated immediately instead of waiting for the user to reboot each time after changing.  (Note: you still have to reboot each time to change the port that it uses.)

Future ideas for the mouse driver:
I'm thinking about making a hardware solution to the problem as well, so that you can hook the serial mouse up to a converter connected to the ADB port.  Another idea is to make an ADB converter for IBM AT compatible keyboards.

Comment:
Early 93 I made a IBM AT keyboard to Mac Keyboard converter.  It works for ADB Macs as well as the Mac Plus.

Other software by me:
"Chuck's Printer Driver"  -- Allows you to connect an Epson compatible 9-pin or 24-pin printer up to your Mac.

Disclaimer:
I take no responsibility for anything you my do to damage or destroy your Mac.  This software is used at your own risk.  Microsoft, Mouse Systems, Epson, Macintosh, Think C, and any other trademarks are copyright of their respective owners.